import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home/Home.vue'
//Home的子路由
import Expend from '@/views/home/Expend'
import Income from '@/views/home/Income'
//accountBook的路由
// import AccoutBookHome from '@/views/accountBook/HomePage'
const AccoutBookHome =()=>import('@/views/accountBook/HomePage')
//label的路由
import LabelHome from '@/views/label/LabelHome'
//statistics的路由
import StatisticsHome from '@/views/statistics/Shome'
Vue.use(VueRouter)

  const routes = [
  {
    path: '*',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path:'expend/',
        component:Expend
      },
      {
        path:'income/',
        component:Income
      },
      {
        path:'/',
        redirect:'expend'
      }
    ]
  },
  {
    path:'/accountbook',
    component:AccoutBookHome,
  },
  {
    path:'/label',
    component:LabelHome,
  },
  {
    path:'/statistics',
    component:StatisticsHome,
  },
 
]

const router = new VueRouter({
  routes
})

export default router
